<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OA协同办公系统</title>
<link href="css/table.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/openwindow.js"></script>
<script type="text/javascript">
function menuadd(val){
	var url="selectQuickMenu.action?name="+val;
	openWindow(url,850,600);
}

function saveMenu(menuName,name){
	var menutwo = menuName.split("_");
	for(var i=0;i<menutwo.length;i++){
		if(i == 0){
			$("#menuId"+name).val(menutwo[i]);
		}else{
			$("#menuName"+name).val(menutwo[i]);
		}
	}
}

function submitMenu(){
	$.post("quickMenusave.action",$("form").serialize(),function(data){
		if(data=='success'){
			window.location.href="quickMenu.action";
		}
	});	
}

function addImg(val){
	var url="addImg.action?name="+val;
	openWindow(url,850,500);
}

function selectImg(imgId,name){
	$("#imgUrl"+name).val(imgId);
	$("#img"+name).attr("src",imgId);
}

function clearMenu(){
	var inputs=$("table").find("input[type='text']");
	var inputs1=$("table").find("input[type='hidden']");
	for(var i=0;i<inputs.length;i++){
		inputs[i].value="";
	}
	for(var i=0;i<inputs1.length;i++){
		inputs1[i].value="";
	}
}
function imgLook(){
	var url="imgLook.action";
	openWindow(url,850,500);
}

function fileImg(){
	window.showModalDialog('intFileImg.action',null,'dialogHide:yes;help:no;status:no;scroll:yes;unadorned:no;unadorned:yes;resizable:yes;dialogHeight:430px;dialogWidth:780px');
}

function removeMenu(id1,id2){
	$("#"+id1).val('');
	$("#"+id2).val('');
}
</script>
</head>
<body>
<input onclick="fileImg()" style="float: right;margin-right: 10px" type="button" class="button_04" value="上传图标" >
<input onclick="imgLook()" style="float: right;margin-right: 10px" type="button" class="button_04" value="图标查看" >
<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody>
  <tr>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
    <td style="background: url('image/wsoa_window_002.gif');"><table border="0" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td align="center" style="background: url('image/wsoa_window_002.gif');" width="10"><img src="image/center_19.gif"></td>
        <td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
        <td>系统管理 &gt; 个人设置 &gt; 快捷便签</td>
        </tr>
    </tbody>
    </table></td>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
  </tr>
  <tr>
    <td style="background: url('image/wsoa_window_010.gif');"  width="1">&nbsp;</td>
    <td>

<form method="post" name="quickMenuFrom" id="quickMenuFrom">
<table width="700px"  style="margin-top: 10px" align="center">
	<tr >
		<td align="center">显示顺序</td>
		<td >菜单名称</td>
		<td align="center">图标设置</td>
		<td align="center">操作</td>
	</tr>
	<tr>
		<td align="center">
			<input name="px" value="1" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="5" size="14" type="text"  style="width:50px">
		</td>
		<td >
			<input name="menuName" id="menuNameOne" type="text" style="width:100px;vertical-align: middle; " readonly="readonly">
			<input name="menuId" id="menuIdOne" type="hidden">
			<input type="button" class="sscc" style="vertical-align: middle; " onclick="menuadd('One')">
		</td>
		<td align="center">
			<img style="cursor: pointer" id="imgOne" onclick="addImg('One')" src="image/k1.jpg" width="30" height="30" >
			<input name="imgUrl" id="imgUrlOne" type="hidden" value="image/k1.jpg">
		</td>
		<td align="center"><input onclick="removeMenu('menuNameOne','menuIdOne')" class="button_02" type="button" value="清空"> </td>
	</tr>
	<tr>
		<td align="center">
			<input name="px" onkeyup="this.value=this.value.replace(/\D/g,'')" value="2"  onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="5" size="14" type="text"  style="width:50px">
		</td>
		<td>
			<input name="menuName" id="menuNameTwo" type="text" value="" style="width:100px;vertical-align: middle;" readonly="readonly">
			<input name="menuId" id="menuIdTwo"  type="hidden">
			<input type="button" class="sscc" style="vertical-align: middle;" onclick="menuadd('Two')">
		</td>
		<td align="center">
			<img style="cursor: pointer" id="imgTwo" onclick="addImg('Two')" src="image/k1.jpg" width="30" height="30" >
			<input name="imgUrl" id="imgUrlTwo" type="hidden" value="image/k1.jpg">
		</td>
		<td align="center"><input onclick="removeMenu('menuNameTwo','menuIdTwo')" class="button_02" type="button" value="清空"> </td>
	</tr>
	<tr>
		<td align="center">
			<input name="px" value="3" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="5" size="14" type="text"  style="width:50px">
		</td>
		<td>
			<input name="menuName" id="menuNameThree" type="text" style="width:100px;vertical-align: middle;" readonly="readonly">
			<input name="menuId" id="menuIdThree" type="hidden">
			<input type="button" class="sscc" style="vertical-align: middle;" onclick="menuadd('Three')">
		</td>
		<td align="center">
			<img style="cursor: pointer" id="imgThree" onclick="addImg('Three')" src="image/k1.jpg" width="30" height="30" >
			<input name="imgUrl" id="imgUrlThree" type="hidden" value="image/k1.jpg">
		</td>
		<td align="center"><input onclick="removeMenu('menuNameThree','menuIdThree')" class="button_02" type="button" value="清空"> </td>
	</tr>
	<tr>
		<td align="center">
			<input name="px" value="4" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="5" size="14" type="text"  style="width:50px">
		</td>
		<td>
			<input name="menuName"   id="menuNameFour" type="text" style="width:100px;vertical-align: middle;" readonly="readonly">
			<input name="menuId"  id="menuIdFour" type="hidden">
			<input type="button"   class="sscc" style="vertical-align: middle;" onclick="menuadd('Four')">
		</td>
		<td align="center">
			<img style="cursor: pointer" id="imgFour" onclick="addImg('Four')" src="image/k1.jpg" width="30" height="30" >
			<input name="imgUrl" id="imgUrlFour" type="hidden" value="image/k1.jpg">
		</td>
		<td align="center"><input onclick="removeMenu('menuNameFour','menuIdFour')" class="button_02" type="button" value="清空"> </td>
	</tr>
	<tr>
		<td align="center">
			<input name="px" value="5" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="5" size="14" type="text"  style="width:50px">
		</td>
		<td>
			<input name="menuName"  id="menuNameFive" type="text" style="width:100px;vertical-align: middle;" readonly="readonly">
			<input name="menuId"   id="menuIdFive" type="hidden">
			<input type="button"  class="sscc" style="vertical-align: middle;" onclick="menuadd('Five')">
		</td>
		<td align="center">
			<img style="cursor: pointer" id="imgFive" onclick="addImg('Five')" src="image/k1.jpg" width="30" height="30" >
			<input name="imgUrl" id="imgUrlFive" type="hidden" value="image/k1.jpg">
		</td>
		<td align="center"><input onclick="removeMenu('menuNameFive','menuIdFive')" class="button_02" type="button" value="清空"> </td>
	</tr>
	<tr>
		<td align="center">
			<input name="px" value="6" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" maxlength="5" size="14" type="text"  style="width:50px">
		</td>
		<td>
			<input name="menuName"   id="menuNameSix" type="text" style="width:100px;vertical-align: middle;" readonly="readonly">
			<input name="menuId"   id="menuIdSix" type="hidden">
			<input type="button"  class="sscc" style="vertical-align: middle;" onclick="menuadd('Six')">
		</td>
		<td align="center">
			<img style="cursor: pointer" id="imgSix" onclick="addImg('Six')" src="image/k1.jpg" width="30" height="30" >
			<input name="imgUrl" id="imgUrlSix" type="hidden" value="image/k1.jpg">
		</td>
		<td align="center"><input onclick="removeMenu('menuNameSix','menuIdSix')" class="button_02" type="button" value="清空"> </td>
	</tr>
	<tr>
		<td><input onclick="submitMenu()" class="button_02" type="button" value="提交"> </td>
		<td><input onclick="clearMenu()" class="button_04" type="button" value="全部清空"> </td>
		<td></td>
	</tr>
</table>
</form>

    </td>
<td style="background: url('image/wsoa_window_006.gif');"  width="1">&nbsp;</td></tr>
  <tr>
    <td height="1" width="1"><img src="image/wsoa_window_009.gif" height="16" width="14"></td>
    <td style="background: url('image/wsoa_window_008.gif');" height="1"></td>
    <td height="1" width="1"><img src="image/wsoa_window_007.gif" height="16" width="12"></td>
  </tr>
</tbody>
</table>
</body>
</html>